<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_address', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default('0')->comment('用户ID');
            $table->string('name')->default('')->comment('收货人姓名');
            $table->string('phone')->default('')->comment('电话');
            $table->string('area')->default('')->comment('所在地区');
            $table->string('address')->nullable()->comment('收货地址');
            $table->tinyInteger('is_default')->default('0')->comment('是否默认:0=否,1=是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_address');
    }
}
